<template>
  <div>
    <a-radio-group
      v-if="listLibrarySizeOptions.length > 0"
      :options="translateOptions(listLibrarySizeOptions)"
      v-model:value="modelValue"
      v-bind="$attrs"
      :disabled="disabled"
      @change="onChange"
    ></a-radio-group>
    <div v-else class="text-gray-400">没有数据</div>
  </div>
</template>

<script setup lang="ts">
import { listLibrarySizeOptions, getLibrarySizeOptions } from '@/api/modules/utils/data';
import { translateOptions } from '@/utils/common/common';

const modelValue = defineModel('modelValue');

const emit = defineEmits(['change']);
const onChange = () => {
  emit('change', modelValue.value);
};
defineProps<{
  disabled?: boolean;
}>();
onMounted(() => {
  getLibrarySizeOptions();
});
</script>

<style lang="scss" scoped></style>
